package com.huitu.whht.ribbon_customer_feign.Service;

import com.huitu.whht.ribbon_customer_feign.Service.Impl.HelloSeviceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Service
@FeignClient(value = "test-Service",fallback= HelloSeviceImpl.class)
public interface HelloSevice {

    /**
     * 对应具体服务中的接口地址,这里指的是service-a和service-b
     * 对外提供的具体的接口服务,如com.easystudy.controller.ServiceAController的testA暴露的对外接口"/hello"
     *
     * @return
     */
    @RequestMapping(value = "hello")
    String hello();

    @RequestMapping(value = "/hello2", method = RequestMethod.HEAD)
    String hello(@RequestHeader("name") String name,
                 @RequestHeader("password") String password);

}
